const path = require('path');
const puppeteer = require('puppeteer');
const args = [
    '--no-sandbox',
    '--disable-setuid-sandbox',
    `--window-size=${1920},${1200}`,
    '--lang=en',
    // '--proxy-server=127.0.0.1:1087'
]
process.title = "node-pawer"

const start = async function () {
    const browser = await puppeteer.launch({
        // headless: false,
        args,
        userDataDir: path.resolve('./en-profile'),
        defaultViewport: { width: 1920, height: 1200 },
    });
    const alexamaster = 'https://www.alexamaster.net/Master/113421';
    let pages = await browser.pages();
    const page = pages[0];
    await page.goto(alexamaster);

    setTimeout(async () => {
        await browser.close();
        start();
    }, 60 * 60 * 1000);
}
start();